package indi.zhifa.recipe.bailan5.coupon.dao.service.impl;


import indi.zhifa.recipe.bailan.framework.mysql.entity.annotations.ZfDbService;
import indi.zhifa.recipe.bailan.framework.mysql.service.impl.ZfDbServiceImpl;
import indi.zhifa.recipe.bailan5.coupon.dao.mapper.CouponObjectMapper;
import indi.zhifa.recipe.bailan5.coupon.dao.service.ICouponObjectDbService;
import indi.zhifa.recipe.bailan5.coupon.entity.po.CouponObjectEntity;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;

import java.io.Serializable;

/**
 * <p>
 * 消费券实体 服务实现类
 * </p>
 *
 * @author 织法
 * @since 2023-02-08
 */
@CacheConfig(cacheNames = "busy_coupon_object")
@ZfDbService(name="CouponObjectEntity")
public class CouponObjectDbServiceImpl extends ZfDbServiceImpl<CouponObjectMapper, CouponObjectEntity> implements ICouponObjectDbService {

    @Cacheable(key = "#pId")
    public CouponObjectEntity check(Serializable pId){
        return super.check(pId);
    }

    @CachePut(key = "#pId")
    public CouponObjectEntity savePull(Long pId,CouponObjectEntity pEntity){
        return super.savePull(pId,pEntity);
    }

    @CachePut(key = "#pId")
    public CouponObjectEntity updatePull(Long pId, CouponObjectEntity pEntity){
        return super.updatePull(pId,pEntity);
    }

    @CacheEvict(key = "#pId")
    public CouponObjectEntity deleteById(Serializable pId){
        return super.deleteById(pId);
    }
}
